-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compare tractograms (TODI, TDI, ACC) #767
Conversation
Hello @frheault, Thank you for updating !
Comment last updated at 2024-03-20 17:08:21 UTC |
Build passed ! Good Job 🍻 ! |
1 similar comment
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
…nto compare_tractogram_big
Build passed ! Good Job 🍻 ! |
1 similar comment
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of things to fix but otherwise GTG - fix pep8
@@ -388,3 +389,34 @@ def smooth_line_spline(streamline, smoothing_parameter, nb_ctrl_points): | |||
smoothed_streamline[-1] = streamline[-1] | |||
|
|||
return smoothed_streamline | |||
|
|||
|
|||
def generate_matched_points(sft): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
is_header_compatible_multiple_files, | ||
load_tractogram_with_reference, | ||
validate_nbr_processes) | ||
from scilpy.tractograms.tractogram_operations import tractogram_pairwise_comparison |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like scilpy.tractanalysis.reproducibility_measures it seems to fit our needs here. We'll see in the future if we need to create scilpy.tractograms.reproducibility_measures or scilpy.bundles.reproducibility_measures
help='Optional input mask.') | ||
p.add_argument('--skip_streamlines_distance', action='store_true', | ||
help='Skip computation of the spatial distance between ' | ||
'streamlines.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frheault a quick sentence here please.
if args.out_prefix and args.out_prefix[-1] == '_': | ||
args.out_prefix = args.out_prefix[:-1] | ||
out_corr_filename = os.path.join(args.out_dir, | ||
'{}_correlation.nii.gz'.format(args.out_prefix)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List of the computed differences in the same order as the input voxel. | ||
""" | ||
global sft_1, sft_2, matched_points_1, matched_points_2, tree_1, tree_2, \ | ||
sh_data_1, sh_data_2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We keep it as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick comment and a pep8 fix then LGTM @EmmaRenauld or @karanphil if you have some time I would need a second review of this code. Thank you in advance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
||
def normalize_metric(metric, reverse=False): | ||
""" | ||
Normalize a metric array to a range between 0 and 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could actually work with an array of any dimension. It does not have to be a volume. Ex, it is probably useful everytime we want to change the range of a colormap. Should we put it in utils? @arnaudbore
Quick description
Scripts to compute differences between tractograms (or bundles)
2 big tractograms can be multi processed (2x2GB = 2h at 20 CPU)
It computes TODI+ACC, Correlation of TDI, voxel-wise distances of streamlines (using FSS)
4 outputs
out_acc.nii.gz: How does local orientations compare?
out_correlation.nii.gz How does the density of streamlines agrees?
out_diff.nii.gz How different is the shape of the streamlines?
out_heatmap.nii.gz Power means of 3 others?
Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
Checklist